package com.hsq.file_;


import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class OutputChain {
    public static void main(String[] args) {
        String fileName = "D:\\git_turtle\\mixedTypes.dat";
        try {
            DataOutputStream dataOut = new DataOutputStream(
                    new BufferedOutputStream(new FileOutputStream(fileName))
            );
            dataOut.writeInt(255);
            System.out.println(dataOut.size() + "byts have been written");
//            dataOut.writeDouble(31.2);
            dataOut.writeInt(-1);
            System.out.println(dataOut.size() + "byts have been written");
//            dataOut.writeBytes("Java");
            dataOut.writeInt(0);
            System.out.println(dataOut.size() + "byts have been written");
            dataOut.close();
        } catch (IOException e) {
            System.out.println(e.toString());
        }
    }
}
